package com.ymatou.promotion.api.service;

import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*作废优惠券接口Call
*FreeMaker Template自动生成代码
*/
public class InvalidCouponCall extends YmatouBaseCall{
	private static String opurl ="api/Coupon/InvalidCoupon";
	
	public InvalidCouponCall() {
		super(EnvSetup.getSystemUrl("promition_api_coupon"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	/**
	 * 获取Code
	 * 
	 * @return
	 */
	public String getCode() {
		String Code = null;
		try {
			Code = new JSONObject(getReturnData()).getString("Code");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}

	/**
	 * 获取BCode
	 * 
	 * @return
	 */
	public String getBCode() {
		String Code = null;
		try {
			Code = new JSONObject(getReturnData()).getString("BCode");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}

	/**
	 * 获取Msg
	 * 
	 * @return
	 */
	public String getMsg() {
		String Code = null;
		try {
			Code = new JSONObject(getReturnData()).getString("Msg");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}
	
	/**
	 * 获取Data
	 * 
	 * @return
	 */
	public String getData() {
		String Code = null;
		try {
			Code = new JSONObject(getReturnData()).getString("Data");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}
	
	/**
	 * 获取MessageText
	 * 
	 * @return
	 */
	public String getMessageText() {
		String Code = null;
		try {
			Code = new JSONObject(getData()).getString("MessageText");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}	
	
	/**
	 * 获取BatchCode
	 * 
	 * @return
	 */
	public String getBatchCode() {
		String Code = null;
		try {
			Code = new JSONObject(getData()).getString("BatchCode");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}	
	
	/**
	 * 获取TotalCouponNum
	 * 
	 * @return
	 */
	public String getTotalCouponNum() {
		String Code = null;
		try {
			Code = new JSONObject(getData()).getString("TotalCouponNum");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}	
	
	/**
	 * 获取ReceiveNum
	 * 
	 * @return
	 */
	public String getReceiveNum() {
		String Code = null;
		try {
			Code = new JSONObject(getData()).getString("ReceiveNum");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}	
	
	/**
	 * 获取InvalidNum
	 * 
	 * @return
	 */
	public String getInvalidNum() {
		String Code = null;
		try {
			Code = new JSONObject(getData()).getString("InvalidNum");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}	
}